package com.abysshal.icarte.datamodel.obj;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Order {
	private Long id;
	private Date createTime;
	private Date updateTime;
	private int desknum;
	private int totalCost; //in fen,
	private Map<Long, Integer> menus;
	
	public Order(){
		menus = new HashMap<Long, Integer>();
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public int getDesknum() {
		return desknum;
	}

	public void setDesknum(int desknum) {
		this.desknum = desknum;
	}

	public int getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(int totalCost) {
		this.totalCost = totalCost;
	}

	public Map<Long, Integer> getMenus() {
		return menus;
	}

	public void add(Long menuId, int num) {
		Integer count = menus.get(menuId);
		if (count == null) count = 0;
		menus.put(menuId, count + num);
	}
	
	
}
